﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Profile;
using System.Data;
using Gift.Model;
using Gift.DAL;


namespace WebSite.admin.member
{
    public partial class member_msg_add : BaseAdmin
    {
        readonly DALMemberMsg theMemberMsg = new DALMemberMsg();
        tbMemberMsg oMemberMsg;
        // Methods
        private void BuildForm()
        {
            oMemberMsg = theMemberMsg.GetModel(int.Parse(Request.QueryString["mid"]));
            this.lblTitle.Text = oMemberMsg.title;
            this.txtRemark.Text = oMemberMsg.replay;

        }


        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                if (base.Request.QueryString["mid"] != null)
                {
                    this.BuildForm();
                }
            }
        }

        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            oMemberMsg = theMemberMsg.GetModel(int.Parse(Request.QueryString["mid"]));
            oMemberMsg.replay = this.txtRemark.Text.Trim();
            oMemberMsg.replaytime = DateTime.Now;
            theMemberMsg.Update(oMemberMsg);
            ExtAspNet.Alert.Show("保存成功！");
            ExtAspNet.PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());

        }

    }
}